<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>

  <TITLE>CS631 -- Advanced Programming in the UNIX Environment</TITLE>
  <STYLE type="text/css">
  body {
  background-color: #FFFFFf;
  }
  </STYLE>
  <STYLE type="text/css">
  li.c1 {list-style: none}
  </STYLE>

</HEAD>

<BODY>
  <TABLE border="1" align="center" cellpadding="15">
    <TR>
      <TD valign="top">
        <H2>CS631 -- Advanced Programming in the UNIX Environment - Midterm Assignment</H2>

        <H3>Midterm Assignment: Implement ls(1)</H3>

        <H4>Summary</H4>
	<p>The objective of this assignment is for you to write a
        significant system tool from scratch.  In doing so, you will learn
        many details of the UNIX filesystem and the general system
        concepts we have covered in class.
	</p>
	<h4>Problem assignment</h4>
	<p>
	Implement the ls(1) command as described in the manual page provided to
	you <a href="ls.pdf">here</a>.
	</p>
	<P>
	Please note that this manual page describes a subset of the options
	available on most systems, so please make sure to consult only this page
	as reference.
	</p>
	<P>
	Your program must follow the <a href="hw">general homework guidelines</a>.
	</p>
	<P>
	Your code should be easily readable and contain comments <b>where
	necessary</b>.
	You should look at <a href="style">this file</a> for
	examples of good coding style.  Follow these guidelines!  As
	before, correct functionality of your program is a <em>necessary,
	but not sufficient</em> pre-condition for a good grade.
	Some of the tests your command needs to pass are those shown in <a
	href="ls-test">this file</a>; you may want to
	use <a href="makelstest">this script</a> to
	create a test directory with a number of files
	that may tickle edge cases.
	</p>
	<h4>Deliverables and Due Date</H4>
	<h5>Snapshot</H5>
	<p>
	You must submit a compilable and working snapshot of
	your project by 2018-10-01, at 16:00.  By then, you should have
	implemented some basic functionality and some of the command-line
	options.  It does not need to work without errors or bugs, but it
	shouldn't segfault either; it should just show that you are making progress.
	Failure to submit the snapshot on time will result in a 10% deduction
	from the grade for the midterm project.
	</p>

	<h5>Final submission</h5>
	<p>Splitting your code into multiple
	<tt>.c</tt> files is mandatory in this
	assignment.  Please make sure to separate
	functionality in a meaningful way as well as
	to make proper use of header files.</p>
	<p>
	The use of <a href="git.html">git</a> as a
	code revision tool is mandatory in this
	assignment.  Please make sure to regularly
	and frequently commit your code changes using
	<em>meaningful</em> commit messages and to
	include in your submission
	the output of the <tt>git log</tt> command.
	</p>
	<p>You will submit a single <tt>tar</tt> archive named
	<em>username</em>-midterm.tar (where "<em>username</em>"
	is your Stevens username) that will extract
	into a directory named after your username.  In that directory
	will be multiple <tt>.c</tt> files, a <tt>Makefile</tt>, your
	<tt>README</tt>, as well as your usual <tt>checklist</tt>.
	</p>
	<p>
	For example, I would submit the file <tt>jschauma-midterm.tar</tt>
	by creating everything like this:
	</p>
	<p>
	<verbatim><tt><pre>
$ mkdir $USER
$ cd $USER
$ ls
Makefile        checklist       ls.c      print.c
README          cmp.c           ls.h      print.h
$ git log &gt; LOG
$ cd ..
$ tar cf ${USER}-midterm.tar ${USER}
	</pre></tt></verbatim></p>
           <p>
             The due date for this assignment is 2018-10-15 16:00.  Please
             attach the file to an email sent from your <tt>@stevens.edu</tt>
             email address to <a
             href="mailto:jschauma@stevens.edu?subject=[CS631] midterm">jschauma@stevens.edu</a>
             with a subject of "[CS631] midterm".
           </p>

	<h5>Extra Credit</h5>
	<p>For 10 extra credit points, implement the "<tt>-C</tt>" option
	("Force multi-column output; this is the default when output is to a terminal."),
	which nicely formats the output similar to the way the OS provided
	version of ls(1) does.</p>
	<p>For 5 extra credit points, implement the "<tt>-x</tt>" option
	("The same as -C, except that the multi-column output is produced with
	entries sorted across, rather than down, the columns.").</p>
	<p>Both of these options take the <tt>COLUMNS</tt> environment
	variable into account.</p>
        <hr>
        [<a href="index.html">Course Website</a>]
</BODY>
</HTML>
